export function setCookie(key: string, value: any, day: number) {
    document.cookie = `${key}=${value};max-age=${day * 24 * 60 * 60};path=/`;
  }
  export function deleteCooike(name:string){
    document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"
  }
  
  export function getCookie(key: string) {
    let allCookie = document.cookie.split('; ');
    for (const val of allCookie) {
      let keyVal = val.split('=');
      if (keyVal[0] == key) {
        return keyVal[1];
      }
    }
    return null;
  }